package com.ruoyi.bizsys.mapper;

import java.util.List;

import com.ruoyi.bizsys.domain.BankAccount;
import com.ruoyi.bizsys.vo.BankAccountVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * BankAccountMapper接口
 *
 * @author african-loan
 * @date 2021-12-28
 */
public interface BankAccountMapper{
    /**
     * 查询BankAccount
     *
     * @param id BankAccountID
     * @return BankAccount
     */
    public BankAccount selectBankAccountById(Long id);

    /**
     * 查询BankAccount列表
     *
     * @param bankAccount BankAccount
     * @return BankAccount集合
     */
    public List<BankAccount> selectBankAccountList(BankAccount bankAccount);

    /**
     * 新增BankAccount
     *
     * @param bankAccount BankAccount
     * @return 结果
     */
    public int insertBankAccount(BankAccount bankAccount);

    /**
     * 修改BankAccount
     *
     * @param bankAccount BankAccount
     * @return 结果
     */
    public int updateBankAccount(BankAccount bankAccount);

    /**
     * 删除BankAccount
     *
     * @param id BankAccountID
     * @return 结果
     */
    public int deleteBankAccountById(Long id);

    /**
     * 批量删除BankAccount
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteBankAccountByIds(Long[] ids);

    int updateBankAccountIsDefault(BankAccount bankAccount);

    List<BankAccountVo> selectBankAccountAndNameList(BankAccount bankAccount);

    /**
     * 根据account查询数量
     * @param account
     * @return
     */
    int selectCountByUserId(BankAccount account);

    int countByCustNo(@Param("userId") String userId);

    @Update("update bank_account set state=#{code} where cust_no=#{custNo}")
    void updateStates(@Param("custNo") String custNo, @Param("code")String code);

    String selectBankAccountmaxCnt(String custNo);

    int selectBankAccountCnt(String custNo);
}
